Profiling

#include support.h>

also see gprof.ttp and -pg option to gcc

void monstartup(void &sstarf#star;lpc, void &sstarf#star;hpc); High level interface to profil. [lpc,hpc] is the range to sample. Necessary memory is dynamically allocated.

void monitor(void &sstarf#star;lpc, void &sstarf#star;hpc, void &sstarf#star;buf, size_t bsiz, unsigned int nfunc); Low level interface to profil. buf is a user supplied buffer. PC samples over [lpc,hpc] and mcount() call records are accumulated in buf.

void moncontrol(long flag); Selectively control profiling in a program.

int profil(void &sstarf#star;buf, size_t bsiz, size_t off, int shift); Execution time profil. Pc is examined every 20ms, (PC-off)$\gg$ shift if in range, will increment short in buf.